package com.face.util;

import com.face.task.SchedulTask;

public class WechatContact {

    public static final String PUSH_HEADER = "你好，你有一个顾客光临门店";

    //获取微信Openid
    private static final String gainWechatOpenidUrlFirst = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=";
    private static final String gainWechatOpenidUrlsecond = "&secret=";
    private static final String gainWechatOpenidUrlthird = "&code=";
    private static final String gainWechatOpenidUrlLast = "&grant_type=authorization_code";

    public static String getGainOpenidURL(String appId, String secret, String code) {

        return gainWechatOpenidUrlFirst + appId + gainWechatOpenidUrlsecond + secret +
                gainWechatOpenidUrlthird + code + gainWechatOpenidUrlLast;
    }

    //发送模板消息
    private static final String pushTemplateURL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=";

    public static String getTemplateURL() {
        return pushTemplateURL + SchedulTask.getAccesstoken();
    }

    private static final String REMARK_FOOTER = "\n请准备好接待客人";

    public static String getPushRemark(String type, String group, String recent, Integer visitedCount) {

        return "客户类型：" + type + "\n客户群体：" + group + "\n最近到访：" + recent +
                "\n到访次数：" + visitedCount + REMARK_FOOTER;
    }

    private WechatContact() {
    }
}
